/* 
注意：此文件不要做改动11
*/
const files = require.context('./packages', true, /index\.vue$/);
const remoteComponents = [];
files.keys().forEach(key => {
  if (~key.indexOf('@tiamaes')) return;
  const dirs = key.split('/');
  const title = dirs[2].replace('.vue', '');
  const img = require(`./packages/${dirs[1]}/${title}/component.png`);
  const config = require(`./packages/${dirs[1]}/${title}/config.js`).default;
  remoteComponents.push({
    name: `${dirs[1]}${dirs[2]}`, // 唯一的name地址
    title: config.title || title,
    vueSysComponentDirName: title,
    vueFile: files(key).default,
    ...config,
    img,
  });
});

export default remoteComponents;
